home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / phreaky! / phreaky!.bas < prev   
Encoding:
BASIC Source File  |  1999-10-07  |  4.3 KB  |  156 lines

  1. Attribute VB_Name = "Module1"
  2. 'PHREAKY!!!'
  3.  
  4. 'Ok people... here's some KINDA useful, but mostly lamely cool
  5. 'Visual Basic options i decided to throw together...
  6. 'if you want me to make new verzion, send me some feedback!
  7. 'worldfamouskr0q@phreaker.net'
  8.  
  9. 'Also,if you find any bugs, email me at the eMail address
  10. 'above, and I'll fix them!
  11.  
  12. 'thanks and enjoy my first module released to the public!!!
  13.  
  14. Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
  15. Declare Function MciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
  16. Declare Function ExitWindowsEx Lib "user32" _
  17. (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
  18. Public Const EWX_FORCE = 4
  19. Public Const EWX_REBOOT = 2
  20. Public Const EWX_SHUTDOWN = 1
  21. Declare Function FindWindow% Lib "user32" Alias "FindWindowA" (ByVal lpClassName$, ByVal lpWindowName$)
  22. Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
  23. Sub CDRom_Open()
  24. 'Open's your CD Rom drive...AKA cup holder...
  25.  
  26.     retvalue = MciSendString("set CDAudio door open", vbNullString, 0, 0)
  27. End Sub
  28. Sub CDRom_Close()
  29. 'Closes your CD Rom drive
  30.  
  31.     retvalue = MciSendString("set CDAudio door closed", vbNullString, 0, 0)
  32. End Sub
  33. Sub CRRom_Ghost()
  34. 'Pretty stupid... might be funny if you leave this running on someone's computer
  35.     'while they're out to coffe... SET THE PAUSE INTERVALS TO WHATEVER YOU WANT,
  36.     'DEPENDING ON WHAT YOU WANT THIS TO ACT LIKE...
  37.     
  38. Do
  39.     Call CDRom_Open
  40.     Pause 1
  41.     Call CDRom_Close
  42.     Pause 3
  43. Loop
  44. End Sub
  45.  
  46. Sub Computer_Restart()
  47. 'Will restart the computer
  48.  
  49.     ForcedShutdown = ExitWindowsEx(EWX_REBOOT, 0&)
  50. End Sub
  51. Sub Computer_Shutdown()
  52. 'Will shut-down the computer
  53.  
  54.     StandardShutdown = ExitWindowsEx(EWX_SHUTDOWN, 0&)
  55. End Sub
  56. Sub Computer_ForceShutdown()
  57. 'Forces a shut-down of the computer
  58.  
  59.     ForcedShutdown = ExitWindowsEx(EWX_FORCE, 0&)
  60. End Sub
  61. Sub Mouse_Show()
  62. 'Shows your mouse cursor
  63.  
  64.     Hid$ = ShowCursor(True)
  65. End Sub
  66. Sub Mouse_Hide()
  67. 'Hides your mouse cursor
  68.  
  69.     Hid$ = ShowCursor(False)
  70. End Sub
  71.  
  72. Sub Mouse_Insane()
  73. 'Crzy mouse movement.. could be useful to make a prog like Fake Surf...
  74.  
  75. Do
  76.     boob = (Rnd * 400)
  77.     boob2 = (Rnd * 400)
  78.     whatever = SetCursorPos(boob, boob2)
  79.     DoEvents
  80. Loop
  81. End Sub
  82. Sub StartMenu_Hide()
  83. 'Hides the Start Menu
  84.     
  85.     c% = FindWindow("Shell_TrayWnd", vbNullString)
  86.     a = ShowWindow(c%, SW_HIDE)
  87. End Sub
  88. Sub StartMenu_Show()
  89. 'Shows the Start Menu
  90. ' doesn't work for me, but maybe that's cause i'm on Windows NT...
  91.  
  92.     c% = FindWindow("Shell_TrayWnd", vbNullString)
  93.     a = ShowWindow(c%, SW_SHOW)
  94. End Sub
  95.  
  96. Function CtrlAltDel_Enable()
  97. 'This re-enables CTRL+ALT+Delete
  98.  
  99.     Dim ret As Integer
  100.     Dim pOld As Boolean
  101.      ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, pOld, 0)
  102. End Function
  103. Function CtrlAltDel_Disable()
  104. 'This will disable the CTRL+ALT+DELETE function of Windows.
  105.     'Make sure you re-enable this before your prog ends,
  106.     'or the person using this is screwed!
  107.     
  108.     Dim ret As Integer
  109.     Dim pOld As Boolean
  110.     ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, pOld, 0)
  111. End Function
  112.  
  113. Sub ScreenSaver_On()
  114. 'Turns on your screen saver... close the screen saver by doing something... duh...
  115. 'Not sure if this works either... i don't use screen savers...
  116.        
  117.     Dim lResult As Long
  118.     Const WM_SYSCOMMAND = &H112
  119.     Const SC_SCREENSAVE = &HF140
  120.     lResult = SendMessage(-1, WM_SYSCOMMAND, SC_SCREENSAVE, 0&)
  121. End Sub
  122. Sub beep()
  123. 'Not much... tossed this in for those who didn't know about this..
  124. 'you don't need this module to use this, just type beep, and it'll
  125. 'make that beep sound...
  126.  
  127.     beep
  128. End Sub
  129. Sub PlayWav(DiR)
  130. 'Plays the specified WAV file...
  131.  
  132. Dim X%
  133. SoundName$ = DiR
  134.    wFlags% = SND_ASYNC Or SND_NODEFAULT
  135.    X% = sndPlaySound(SoundName$, wFlags%)
  136. End Sub
  137. Sub Pause(interval)
  138. 'Don't modify this!
  139.     'This just puts a delay between actions...
  140.     'like...
  141.  
  142. 'Call CtrlAltDel_Disable
  143. 'Pause 15
  144. 'Call CtrlAltDel_Enable
  145.  
  146. 'That will put a 15 second pause between the
  147.     'CTRL ALT DELETE Disable and Enable
  148.     
  149.     Dim Current
  150.     
  151.     Current = Timer
  152.     Do While Timer - Current < Val(interval)
  153.         DoEvents
  154.     Loop
  155. End Sub
  156.